package com.plian.system.entity.pf;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

/**
 * @Author: Take-off
 * @Description: TODO 经营业绩考核进度追踪主表
 * @Date: 2022/12/15 10:54 AM
 * @Version: 1.0
 **/
@Data
@TableName("pf_base_business_progress")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BaseBusinessProgress对象", description = "经营业绩考核进度追踪主表")
public class BaseBusinessProgress extends BaseEntity{

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-基本指标")
    private List<BusinessProgress> baseIndicators;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-分类指标")
    private List<BusinessProgress> categoryIndicators;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-行业指标")
    private List<BusinessProgress> industryIndicators;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-其他")
    private List<BusinessProgress> otherIndicators;

    @ApiModelProperty(value = "单据编码")
    private String code;

    @ApiModelProperty(value = "填报年月")
    private String fillingMonth;

    @ApiModelProperty(value = "填报时间")
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
    @JsonFormat(pattern = DateUtil.PATTERN_DATE)
    private Date fillingTime;
    /**
     * 填报单位
     */
    @ApiModelProperty(value = "填报单位")
    private String fillingUnitId;

    /**
     * 审批人
     */
    @ApiModelProperty(value = "审批人")
    private String approvedUser;

    /**
     * 审批时间
     */
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    @ApiModelProperty(value = "审批时间")
    private Date approvedTime;

    /**
     * 审批意见
     */
    @ApiModelProperty(value = "审批意见")
    private String approvedOpinion;

    /**
     * 单据类型
     */
    @ApiModelProperty(value = "单据类型")
    private String formType;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-财务绩效")
    private List<BusinessProgress> businessProgresses;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-任务绩效")
    private List<TaskProgress> taskProgresses;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-重大工程")
    private List<MajorProgress> majorProgresses;

    @TableField(exist = false)
    @ApiModelProperty(value = "子表-主责主业")
    private List<MainProgress> mainProgresses;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "基础表Id")
    private Long baseBusinessIndicatorsId;

    @ApiModelProperty(value = "有效完成率")
    private BigDecimal effectiveRate;

    @ApiModelProperty(value = "数据来源 null为系统填报 对应用户id")
    private String dataSource;

    @ApiModelProperty(value = "数据来源id", required = true)
    private String dataSourceId;

    @TableField(exist = false)
    @ApiModelProperty(value = "第三方指标id")
    private String baseIndicatorsCodeId;
    @ApiModelProperty(value = "模块儿类型 0：年度经营考核进度，1：经理层年度经营考核进度 ")
    private Integer moduleType;
    @ApiModelProperty(value = "经理人id")
    private String staffId;
    @ApiModelProperty(value = "经理人姓名")
    private String staffName;

    @TableField(exist = false)
    private List<HashMap> docList;
}
